NumericFunctions.Regex occurrences function

Returns the number of times a pattern occurs in another string

Format

ANSI-SQL Format:

OCCURRENCES_REGEX( Pattern, [ FLAG Options ] IN Subject [ FROM Start ] )

Remarks

Returns the number of times the Pattern occurs in Subject.

Pattern is the regular expression string to search for. For more information on regular expression patterns, refer to Regular Expressions.

If specified, the Option argument changes the pattern matching behaviour. For more information on regular expression options refer to Regular Expression Option Flags.

Subject is the string to be searched.

If specified, the Start argument is the 1-based offset into Subject to start the search. If Start is less than 1 or greater than the length of Subject, the function returns -1. If Start is not specified, the starting position is assumed to be 1, which is the first character in Subject

Example:

OCCURRENCES_REGEX( 'a.b' IN 'aab abb acb adb' ) returns 4


Disclaimer

ClearSCADA 2017 R2